import React, { FC, useMemo } from 'react';
import { Table, DataSet } from 'choerodon-ui/pro';

import getTableProps from './tableDataSet';

interface TableMultipleSorterProps {}

const columns = [
  { name: 'name', sortable: true },
  { name: 'age', sortable: true },
  { name: 'address', sortable: true },
  {
    header: '操作',
    renderer: () => <a onClick={() => alert('删除')}>删除</a>,
  },
];

const TableMultipleSorter: FC<TableMultipleSorterProps> = () => {
  const tableDs = useMemo(() => new DataSet(getTableProps()), []);
  return (
    <Table
      dataSet={tableDs}
      columns={columns}
    />
  );
};

export default TableMultipleSorter;
